export function formatBeijingISO(date: Date | string | number): string {
  const d = new Date(date);
  // Asia/Shanghai is fixed at UTC+08:00 (no daylight saving time)
  const y = d.getUTCFullYear();
  const m = String(d.getUTCMonth() + 1).padStart(2, '0');
  const day = String(d.getUTCDate()).padStart(2, '0');
  const hh = String(d.getUTCHours() + 8).padStart(2, '0');
  // Handle carryover
  const base = new Date(Date.UTC(y, d.getUTCMonth(), d.getUTCDate(), d.getUTCHours() + 8, d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds()));
  const Y = base.getUTCFullYear();
  const M = String(base.getUTCMonth() + 1).padStart(2, '0');
  const D = String(base.getUTCDate()).padStart(2, '0');
  const H = String(base.getUTCHours()).padStart(2, '0');
  const Min = String(base.getUTCMinutes()).padStart(2, '0');
  const S = String(base.getUTCSeconds()).padStart(2, '0');
  const ms = String(base.getUTCMilliseconds()).padStart(3, '0');
  return `${Y}-${M}-${D}T${H}:${Min}:${S}.${ms}+08:00`;
}


